package com.cloud.business.service.sys;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.cloud.business.entity.sys.SysMenu;
import com.cloud.business.model.commonvm.DeletePost;
import com.cloud.business.model.commonvm.ResultMsg;
import com.cloud.business.model.sys.sysmenuvm.SysMenuNavTreeVM;
import com.cloud.business.model.sys.sysmenuvm.SysMenuQueryModel;
import com.cloud.business.model.sys.sysmenuvm.SysMenuTreeVM;

import java.util.List;

/**
 * <p>
 * 系统菜单 服务类
 * </p>
 *
 * @author dh
 * @since 2020-03-21
 */
public interface ISysMenuService extends IService<SysMenu> {

    /**
     * 分页列表
     *
     * @param sysMenuQueryModel
     * @param page
     * @param msg
     * @throws Exception
     */
    void getListByPage(SysMenuQueryModel sysMenuQueryModel, IPage<SysMenu> page, ResultMsg msg) throws Exception;

    /**
     * 创建
     *
     * @param sysMenu
     * @return
     * @throws Exception
     */
    Integer create(SysMenu sysMenu, ResultMsg msg) throws Exception;

    /**
     * 更新
     *
     * @param sysMenu
     * @return
     * @throws Exception
     */
    Integer update(SysMenu sysMenu, ResultMsg msg) throws Exception;

    /**
     * 获取单条
     *
     * @param operationId
     * @param objectId
     * @return
     * @throws Exception
     */
    SysMenu getById(Integer operationId, Integer objectId, ResultMsg msg) throws Exception;

    /**
     * 批量删除
     *
     * @param deletePost
     * @return
     * @throws Exception
     */
    int deleteByList(DeletePost deletePost, ResultMsg msg) throws Exception;

    /**
     * 获取菜单树--返回权限是否分配
     * @param operationId
     * @return
     */
    List<SysMenuTreeVM> getMenuTree(Integer operationId);

    /**
     * 获取用户菜单树--返回对应权限码
     * @param operationId
     * @return
     */
    List<SysMenuNavTreeVM> getUserMenuTree(Integer operationId);
}
